﻿@{
    ViewBag.Title = "RangeSongVideo";
    Layout = "~/Views/Shared/_LayoutPublic.cshtml";
}
<link href="../../Styles/SongDetails.css" rel="stylesheet" type="text/css" />
<link href="@Url.Content("../../Styles/Playlist/popbox.css")" rel="stylesheet" type="text/css" />
<script src="../../Scripts/Playlist/popbox.js" type="text/javascript"></script>
 @{
    List<ListenMusic.Playlist_ServiceReference.FavoritePlayList> lst_favaritesPlaylist = ViewBag.songInPlaylist;
    List < ListenMusic.Song_ServiceReference.CountrySong> lst_countrysong = ViewBag.rangeSV;
}
<div id="song-video">
    <div id="song-range">
    <h3 class="title-range">BẢNG XẾP HẠNG CÁC BÀI HÁT @lst_countrysong[0].CountryName.ToUpper() <hr /></h3>
    <div class="content-song">
        <div id="song-details">
            <ul>
        @foreach (ListenMusic.Song_ServiceReference.CountrySong ss in lst_countrysong)
        { 
            <li>
                <a href="/listen/listenpage?singerid=@ss.singerID&songid=@ss.SongID">@ss.SongName</a> <br />
                <span class="sub-detail">
                    Trình bày: <a class="singer" href="/song/searchsong_bysinger?singerid=@ss.singerID">@ss.SingerName</a> | Lượt nghe: @ss.CountView
                </span>
                <div class='popbox'>                
                @if (Session["user"] == null)   
                {
                    <a href="#login-box" class="login-window">
                    <img src='../../Images/Icons/add.png' alt="" width="14px" title="Thêm vào danh sách yêu thích" style='position:relative' />
                    </a>                      
                }
                else
                {
                    bool flag = true;
                    for (int j = 0; j < lst_favaritesPlaylist.Count(); j++)
                    {
                        if (lst_favaritesPlaylist[j].SongID.Equals(@ss.SongID))
                        {
                            <a class='open1' href='#'>
                                <img src='../../Images/Icons/check.png' alt="" style='width:14px;position:relative' />
                            </a>  
                            flag = false;
                            break;
                        }
                    }
                    if (flag == true)
                    {
                        <a class='open' href="#">
                            <img src='../../Images/Icons/add.png' alt=""  title="Thêm vào danh sách yêu thích" style='width:14px;position:relative' />
                        </a>                       
                    }
                }
                <a href="@Url.Action("dowloadfile", "dowload", new { url = @ss.SongURL })"><img src="../../Images/Icons/download.jpg" title="Tải bài hát về máy" width="16" height="16px" alt="" /></a>    
                <div class='collapse'>
                      <div class='box'>
                        <div class='arrow'></div>
                        <div class='arrow-border'></div>
                        <form action="" method="post" id="subForm">
                            <div style="margin-left:20px; margin-top:10px">
                                <select id="cbx-playlist-name" name="cbx-playlist-name" onchange="addMusic(@ss.SongID)">
                                    <option value="">-Chọn-</option>
                                        @if (@Session["user"] != null)
                                        {
                                            foreach (ListenMusic.Playlist_ServiceReference.Playlist pl in ViewBag.playlist)
                                            {
			                                    <option value='@pl.PlaylistID'>@pl.PlaylistName</option>
                                            }
                                        }
                                </select>
                            </div>
                            <div style="margin-left:20px">
                                <input type="text" id="playlistname-@ss.SongID" name="playlistname" placeholder="Tên của laylist" style="width:90px; margin-top:10px;" /> 
                                <a href="#" id="create-playlist" onclick="getID('playlistname-@ss.SongID')" style="font-size:small" >Tạo Playlist</a>
                            </div>
                          <div style="text-align:center; margin-top:10px"><a href="#" class="close">Cancel</a></div>
                        </form>
                      </div>
                    </div>
                </div>
            </li>
        }
        </ul>
       
        </div>    
    </div>
    </div>
</div>
